package com.itheima.idea;

public class Demo1StringBuilder {
    public static void main(String[] args) {
        long start = System.currentTimeMillis();

        StringBuffer sb = new StringBuffer();

        for (int i = 1; i <= 50000; i++) {
            sb.append(i);
        }
        System.out.println(sb);

        long end = System.currentTimeMillis();

        System.out.println(end - start);
        //method();
    }
    /*public  static  void method() {
        long start = System.currentTimeMillis(); //获取1970年1月1日 0时0分0秒
        String s = "";

        for (int i = 1; i <= 50000; i++) {
            s += i;
        }
        System.out.println(s);

        long end = System.currentTimeMillis();

        System.out.println(end - start);*/
   // }
}


